from myself.listnode import ListNode


def createLinkedList(nums):
    h = t = ListNode(None)

    for num in nums:
        t.val, t.next = num, ListNode(None)
        t = t.next

    return h


if __name__ == '__main__':
    header = createLinkedList([1, 3, 5, 5, 7, 8])

    while header:
        print(header.val)
        header = header.next
